# coding:utf-8

class Person():
    def __init__(self, name):
        self.name = name

    def say(self):
        print("我的名字是%s" % (self.name))


#
# p1=Person("小明")
# p1.say()

# 定义子类Student

class Student(Person):
    def __init__(self, name, school):
        self.name = name
        self.school = school

    # 对say函数进行重写
    def say(self):
        print("我的名字是%s，我在%s上学" % (self.name, self.school))


# stu1 = Student("小红", "北京第一实验小学")
# stu1.say()


class Worker(Person):
    def __init__(self,name,factory):
        self.name=name;
        self.factory=factory

    def say(self):
        print("我的名字是%s，我在%s工作"%(self.name,self.factory))

worker1=Worker("李叔","腾讯科技")
worker1.say()